package reflect;

import java.lang.reflect.Constructor;

public class Test {
    public static void main(String[] args) throws Exception {
        Class cls = Class.forName("reflect.Student");

        /*Constructor constructor = cls.getConstructor();
        Object obj = constructor.newInstance();*/
        Object obj  = cls.newInstance();
        System.out.println(obj);

        Constructor a = cls.getConstructor(String.class,int.class,char.class);
        Object obj1 = a.newInstance("张三",24,'男');
        System.out.println(obj1);


    }
}
